#include "cvdialog.h"
#include "ui_cvdialog.h"



CVDialog::CVDialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::CVDialog)
{
    ui->setupUi(this);

       cap.open(0);
       if(cap.isOpened()){

            thread = new CVUpdateThread(cap,ui);
            thread->start();
       }else{
            ui->label->setText("open ccd error");
       }
}

CVDialog::~CVDialog()
{
    delete ui;
    cap.release();
   // thread->stop();
}

void CVDialog::on_buttonBox_clicked(QAbstractButton *button)
{
    cap.release();
    // cap.open(0);
}
